import VueRouter from 'vue-router'


//首页子组件
import Home from '../components/tabBar/home.vue'
import Car from '../components/tabBar/car.vue'
import Person from '../components/tabBar/person.vue'
import Login from '../components/mySet/login.vue'
import Shop from '../components/shop/shop.vue'
import MyShop from '../components/shop/myShop.vue'
//个人中心列表
import Order from '../components/myPerson/order.vue'
import Credit from '../components/myPerson/credit.vue'
import Member from '../components/myPerson/member.vue'
import Server from '../components/myPerson/server.vue'
import Coupon from '../components/myPerson/coupon.vue'
import Cash from '../components/myPerson/cash.vue'
import PersonMange from '../components/myPerson/personMange.vue'
//食材列表信息

import Foodmsg from '../components/shop/foodmsg.vue'
import ReadFood from '../components/shop/readFood.vue'
//店主收到的订单
import GetOrder from '../components/mySet/getOrder.vue'
// import { Server } from 'net';

const router = new VueRouter({
    // mode: 'history',
    routes:[

        {
            path: '/',
            redirect: '/home'
        },
        //首页
        {
            path: '/home',
            component: Home
        },
        //购物车
        {
            path: '/car',
            component: Car
        },
        //个人中心
        {
            path: '/person',
            component: Person
        },
        //登陆
        {
            path: '/login',
            component: Login
        },
        //商店设置
        {
            path: '/setShop',
            component: Shop
        },
        //商店
        {
            path: '/shop',
            name: 'shop',
            component: MyShop
        },
        //店主收到的订单
        {
            path: '/getOrder/:orderState',
            name: 'getOrder',
            component: GetOrder
        },
        
        //店主完成的订单
        {
            path: '/alreOrder/:orderState',
            name: 'alreOrder',
            component: GetOrder
        },  
        //用户点餐页面 这里组件也是MyShop 但是路由不同
        {
            path: '/food',
            name: 'food',
            component: ReadFood
        },  
        //订单
        {
            path: '/order/:orderState',
            name: 'order',
            component: Order
        },
        //积分
        {
            path: '/credit',
            component: Credit
        },
        //会员
        {
            path: '/member',
            component: Member
        },
        //个人中心
        {
            path: '/pmanger',
            component: PersonMange
        },
        //我的服务
        {
            path: '/server',
            name: 'server',
            component: Server
        },
        //余额
        {
            path: '/cash',
            component: Cash
        },
        //优惠卷
        {
            path: '/coupon',
            component: Coupon
        },
        //食材详情
        {
            path: '/foodmsg',
            component: Foodmsg
        }
    ]
})

export default router